<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "user_drug".
 *
 * @property int $id
 * @property int $user_id 用户id
 * @property string $barcode 条形码
 * @property string $name 药品商品名
 * @property string $name_intro 药品通用名
 * @property string $spell 拼写
 * @property string $spell_intro 拼音简码
 * @property string $specification 规格
 * @property string $unit 单位
 * @property string $shape 剂型
 * @property string $vender_id 厂家
 * @property string $employ 用法
 * @property string $action 功能
 * @property string $coding 批准文号
 * @property int $status 状态
 */
class UserDrug extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'user_drug';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['user_id'], 'required'],
            [['user_id', 'status',], 'integer'],
            [['employ', 'action'], 'string'],
            [['barcode', 'specification'], 'string', 'max' => 20],
            [['name', 'name_intro', 'spell', 'coding'], 'string', 'max' => 100],
            [['spell_intro'], 'string', 'max' => 10],
            [['unit', 'shape'], 'string', 'max' => 30],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'user_id' => '用户id',
            'barcode' => '条形码',
            'name' => '药品商品名',
            'name_intro' => '药品通用名',
            'spell' => '拼写',
            'spell_intro' => '拼音简码',
            'specification' => '规格',
            'unit' => '单位',
            'shape' => '剂型',
            'vender_id' => '厂家',
            'employ' => '用法',
            'action' => '功能',
            'coding' => '批准文号',
            'status' => '状态',
        ];
    }
}